<template>
    <div class="dashboard-welcome">
      <el-card>
        <div slot="header">
          <span style="font-size: 18px; font-weight: bold">控制台</span>
        </div>
        
        <div class="welcome-content">
          <h2>欢迎使用后台管理系统</h2>
          <p>当前登录用户：{{ userInfo.username }}</p>
          <p>登录时间：{{ userInfo.loginTime }}</p>
          
          <el-row :gutter="20" class="stats-row">
            <el-col :span="6">
              <el-card shadow="hover" class="stats-card">
                <div class="stats-content">
                  <div class="stats-icon user-icon">
                    <i class="el-icon-user"></i>
                  </div>
                  <div class="stats-info">
                    <div class="stats-number">1,234</div>
                    <div class="stats-label">用户数量</div>
                  </div>
                </div>
              </el-card>
            </el-col>
            
            <el-col :span="6">
              <el-card shadow="hover" class="stats-card">
                <div class="stats-content">
                  <div class="stats-icon command-icon">
                    <i class="el-icon-s-order"></i>
                  </div>
                  <div class="stats-info">
                    <div class="stats-number">567</div>
                    <div class="stats-label">命令数量</div>
                  </div>
                </div>
              </el-card>
            </el-col>
            
            <el-col :span="6">
              <el-card shadow="hover" class="stats-card">
                <div class="stats-content">
                  <div class="stats-icon role-icon">
                    <i class="el-icon-s-custom"></i>
                  </div>
                  <div class="stats-info">
                    <div class="stats-number">89</div>
                    <div class="stats-label">角色数量</div>
                  </div>
                </div>
              </el-card>
            </el-col>
            
            <el-col :span="6">
              <el-card shadow="hover" class="stats-card">
                <div class="stats-content">
                  <div class="stats-icon log-icon">
                    <i class="el-icon-document"></i>
                  </div>
                  <div class="stats-info">
                    <div class="stats-number">2,345</div>
                    <div class="stats-label">日志数量</div>
                  </div>
                </div>
              </el-card>
            </el-col>
          </el-row>
        </div>
      </el-card>
    </div>
  </template>
  
  <script>
  import { mapGetters } from 'vuex'
  
  export default {
    name: 'DashboardWelcome',
    computed: {
      ...mapGetters(['userInfo'])
    }
  }
  </script>
  
  <style scoped>
  .welcome-content {
    text-align: center;
  }
  
  .stats-row {
    margin-top: 30px;
  }
  
  .stats-card {
    height: 120px;
  }
  
  .stats-content {
    display: flex;
    align-items: center;
    height: 100%;
  }
  
  .stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 24px;
    color: white;
  }
  
  .user-icon { background: #409EFF; }
  .command-icon { background: #67C23A; }
  .role-icon { background: #E6A23C; }
  .log-icon { background: #F56C6C; }
  
  .stats-info {
    text-align: left;
  }
  
  .stats-number {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
  }
  
  .stats-label {
    color: #909399;
    font-size: 14px;
  }
  </style>